<%@ page contentType="text/html" pageEncoding="UTF-8"%>
<% response.setContentType("text/html; charset=UTF-8");%>
<% request.setCharacterEncoding("utf-8");%>

<%
    Cookie[] cookies = request.getCookies();
    Cookie ckCMND = null;
    Cookie ckUsername = null;
    Cookie ckPassword = null;
    if (cookies != null) {
        for (int i = 0; i < cookies.length; i++) {
            if (cookies[i].getName().equals("cmnd")) {
                ckCMND = cookies[i];
            } else if (cookies[i].getName().equals("username")) {
                ckUsername = cookies[i];
            } else if (cookies[i].getName().equals("password")) {
                ckPassword = cookies[i];
            }
        }
    }
%>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Thi trắc nghiệm online</title>
        <link rel="stylesheet" href="css/style.css" type="text/css" />
        <script type="text/javascript" src="js/general_functions.js"></script>
        <link href="css/login-box.css" rel="stylesheet" type="text/css" />
        <link href="css/login.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="js/login.js"></script>
    </head>
    <body>

        <!-- BEGIN Header -->
        <div id="header">
            <div id="header-content">
                <h1><span>styleshout</span></h1>
                <h2 id="slogan">Thi trắc nghiệm online</h2>
            </div>
        </div>
        <!-- END Header -->

        <!-- BEGIN Content -->
        <div style="padding: 0px 0 0 440px; text-align:left;">
            <div id="login-box">

                <h2 style="font-size: 32;">ĐĂNG NHẬP<a href="signup.jsp" id="signup">Đăng ký</a></h2>
                <div class="type" id="typeTS" onclick="thisinh();">Thí sinh</div>
                <div class="type" id="typeQT" onclick="quantri();">Quản trị</div>
                <div style="clear:both"></div>
                <br />
                <div id="login_failed"></div>

                <div id="thisinh">
                    <div id="login-box-name" style="margin-top:20px;">CMND:</div>
                    <div id="login-box-field" style="margin-top:20px;"><input name="cmnd" id="cmnd" class="form-login" title="CMND gồm 9 chữ số" placeholder="Xin nhập số CMND" value="<% if (ckCMND != null) {
                            out.print(ckCMND.getValue());
                        }%>" size="30" maxlength="9" /></div>
                    <br />
                    <span class="login-box-options"><input type="checkbox" name="rememberTS" id="rememberTS" value="1" <% if (ckCMND != null) {
                            out.print("checked");
                        }%> >. Nhớ tài khoản</span>
                </div>

                <div id="quantri">
                    <div id="login-box-name" style="margin-top:20px;">Username:</div>
                    <div id="login-box-field" style="margin-top:20px;"><input name="username" id="username" class="form-login" title="Username" placeholder="Xin nhập username" value="<% if (ckUsername != null) {
                            out.print(ckUsername.getValue());
                        }%>" size="30" maxlength="30" /></div>
                    <div id="login-box-name">Password:</div>
                    <div id="login-box-field"><input name="password" id="password" type="password" class="form-login" title="Password" placeholder="Xin nhập password" value="<% if (ckPassword != null) {
                            out.print(ckPassword.getValue());
                        }%>" size="30" maxlength="30" /></div>
                    <br />
                    <span class="login-box-options"><input type="checkbox" name="rememberQT" id="rememberQT" value="1" <% if (ckUsername != null) {
                            out.print("checked");
                        }%> >. Nhớ tài khoản</span>
                    <!--
                    <a href="#" style="margin-left:30px;">Forgot password?</a>
                    -->
                </div>
                <script type="text/javascript">thisinh();</script>
                <br />
                <img src="img/login-btn.png" width="103" height="42" style="margin-left:90px;" onclick="login_submit();"/>

            </div>
        </div>
        <!-- END Content -->

        <!-- BEGIN footer -->
        <div id="footer">
            <div id="footer-content">
                <div class="footer-left">
                    <p style="text-align: right">
                        &copy; copyright 2006-2011 <strong class="separator">www.styleshout.com</strong>
                    </p>
                </div>
                <!-- footer ends here -->
            </div>
        </div>
        <!-- END footer -->

    </body>
</html>
